package com.lanniao.service.impl;

import com.lanniao.entity.Dept;
import com.lanniao.entity.TbUser;
import com.lanniao.mapper.DeptMapper;
import com.lanniao.mapper.UserMapper;
import com.lanniao.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    private DeptMapper deptMapper;
    @Autowired
    private UserMapper userMapper;

    @Override
    public Dept getById(Integer id) {
        Dept dept = deptMapper.getById(id);
        return dept;
    }

    @Override
    public List<TbUser> getUserById(Integer deptId) {
        List<TbUser> tbUserList = userMapper.getByDeptId(deptId);
        return tbUserList;
    }
}
